CMAKE_MINIMUM_REQUIRED(VERSION 2.4)

PROJECT( getrap )

SET( GETRAP_SRCS
src/main.cc
src/fMain.cc
src/fAbout.cc
src/fAddFiles.cc
src/fSettings.cc
src/config.cc
src/job.cc
)

SET( GETRAP_MOC_HDRS
include/fMain.h
include/fAbout.h
include/fAddFiles.h
include/fSettings.h
include/job.h
)

SET( GETRAP_UIS
ui/fMain.ui
ui/fAddFiles.ui
ui/fSettings.ui
ui/fAbout.ui
)

SET( GETRAP_RCS
res/resources.qrc
)

IF( WIN32 )
	IF( MINGW )
		   SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
	ENDIF( MINGW )
ENDIF( WIN32 )

ADD_DEFINITIONS( -Wall )

FIND_PACKAGE( Qt4 REQUIRED )

SET( QT_USE_QTNETWORK TRUE )

INCLUDE( ${QT_USE_FILE} )

QT4_ADD_RESOURCES( GETRAP_RC_SRCS ${GETRAP_RCS} )
QT4_WRAP_UI( GETRAP_UI_HDRS ${GETRAP_UIS} )
QT4_WRAP_CPP( GETRAP_MOC_SRCS ${GETRAP_MOC_HDRS} )

INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} include )

ADD_EXECUTABLE( getrap ${GETRAP_SRCS} ${GETRAP_MOC_SRCS} ${GETRAP_RC_SRCS} ${GETRAP_UI_HDRS} )

TARGET_LINK_LIBRARIES(getrap ${QT_LIBRARIES} )
